﻿app.service('deSpecialAttr', function ($http) {
    var apiURL = serverURL + '/DESpecialAtt';

    this.GetAll = function () {
        return $http.get(apiURL);
    }

    this.GetAllByPKey = function (deDictionaryKey) {
        var param = (deDictionaryKey && deDictionaryKey.length > 0) ? '?pkey=' + deDictionaryKey : '';
        return $http.get(apiURL + param);
    }

    this.Add = function (data) {
        return $http.post(apiURL, data);
    }

    this.Edit = function (data) {
        return $http.put(apiURL, data);
    }

    this.Delete = function (id) {
        var params = QueryUriParamBuilder.queryParam("tid", "del").queryParam("id", id).build();
        return $http.get(apiURL + params);
    }
});
